# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.DataMigration.V1.Model.EntityIssue do
  @moduledoc """
  Issue related to the entity.

  ## Attributes

  *   `code` (*type:* `String.t`, *default:* `nil`) - Error/Warning code
  *   `ddl` (*type:* `String.t`, *default:* `nil`) - The ddl which caused the issue, if relevant.
  *   `entityType` (*type:* `String.t`, *default:* `nil`) - The entity type (if the DDL is for a sub entity).
  *   `id` (*type:* `String.t`, *default:* `nil`) - Unique Issue ID.
  *   `message` (*type:* `String.t`, *default:* `nil`) - Issue detailed message
  *   `position` (*type:* `GoogleApi.DataMigration.V1.Model.Position.t`, *default:* `nil`) - The position of the issue found, if relevant.
  *   `severity` (*type:* `String.t`, *default:* `nil`) - Severity of the issue
  *   `type` (*type:* `String.t`, *default:* `nil`) - The type of the issue.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :code => String.t() | nil,
          :ddl => String.t() | nil,
          :entityType => String.t() | nil,
          :id => String.t() | nil,
          :message => String.t() | nil,
          :position => GoogleApi.DataMigration.V1.Model.Position.t() | nil,
          :severity => String.t() | nil,
          :type => String.t() | nil
        }

  field(:code)
  field(:ddl)
  field(:entityType)
  field(:id)
  field(:message)
  field(:position, as: GoogleApi.DataMigration.V1.Model.Position)
  field(:severity)
  field(:type)
end

defimpl Poison.Decoder, for: GoogleApi.DataMigration.V1.Model.EntityIssue do
  def decode(value, options) do
    GoogleApi.DataMigration.V1.Model.EntityIssue.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.DataMigration.V1.Model.EntityIssue do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
